<!--
 * @Author: your name
 * @Date: 2021-07-04 22:52:41
 * @LastEditTime: 2021-07-04 23:12:33
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: \vue_shop_mananger\src\components\users\components\uPagination\uPagination.vue
-->
<template>
  <div class="uPagination">
    <el-pagination
      @size-change="handleSizeChange"
      @current-change="handleCurrentChange"
      :current-page="pagenum"
      :page-sizes="[1, 2, 5, 10]"
      :page-size="pagesize"
      layout="total, sizes, prev, pager, next, jumper"
      :total="total">
    </el-pagination>
  </div>
</template>
<script>
export default {
  props:{
    pagenum:{
      type:Number,
      default:0
    },
    pagesize:{
      type:Number,
      default:0
    },
    total:{
      type:Number,
      default:0
    },
  },
  methods:{
    //监听pagesize的改变
    handleSizeChange(newSize){
      //console.log(newSize);
      this.$emit('sizeChange',newSize);
   
    },
    //监听pagenum的改变
    handleCurrentChange(newPage){
      //console.log(newPage);
      this.$emit('pageChange',newPage);
    }
  }
}
</script>
<style lang="scss" scoped>
.uPagination{
  margin-top: 15px;
}
</style>